<!--
 * @Description: 源订单头部页面
 * @Version: 1.0
 * @Author: Yuanjy
 * @Date: 2020-04-18 18:36:51
 * @LastEditors: Yuanjy
 * @LastEditTime: 2020-04-22 20:40:43
 -->
<template>
  <div class="head-container">
    <!-- 搜索  -->
    <el-date-picker v-model="query.start_time" size="small" type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" />
    <el-select v-model="query.source" filterable size="small" placeholder="客户来源">
      <el-option v-for="item in froms" :key="item" :label="item" :value="item" />
    </el-select>
    <!-- <el-select v-model="query.sku_type" filterable placeholder="SKU类型" @change="changeSkuType" class="user-input">
        <el-option v-for="item in skus" :key="item.key" :label="item.key" :value="item.key">
        </el-option>
    </el-select> -->
    <!-- <el-select v-model="query.goods_info" filterable @change="changeGoodsInfo" placeholder="宝贝描述" class="user-input">
        <el-option v-for="item in skuGoodsInfos" :key="item.key" :label="item.key" :value="item.key">
        </el-option>
    </el-select>
    <el-select v-model="query.price" filterable placeholder="宝贝价格" class="user-input">
        <el-option v-for="item in goodsInfoPrices" :key="item" :label="item" :value="item">
        </el-option>
    </el-select> -->
    <!-- <el-input v-model="query.goods_title" placeholder="宝贝标题" style="width:200px" class="user-input" @keyup.enter.native="handleFilter"></el-input> -->
    <el-input v-model="query.external_procure_number" size="small" placeholder="外部编号" style="width:180px" @keyup.enter.native="handleFilter" />
    <el-input v-model="query.consignee" size="small" placeholder="收件人" style="width:180px" class="user-input" @keyup.enter.native="handleFilter" />
    <el-input v-model="query.phone" size="small" placeholder="手机号码" style="width:180px" class="user-input" @keyup.enter.native="handleFilter" />
    <el-button type="primary" size="mini" class="el-icon-search" @click="toQuery">搜索</el-button>
    <!-- <el-button size="mini" class="el-icon-q" @click="handleReset">撤销</el-button> -->
  </div>
</template>

<script>
import checkPermission from '@/utils/permission' // 权限判断函数
import eForm from './form'

export default {
  components: { eForm },
  props: {
    query: {
      type: Object,
      required: true
    },
    supThis: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      froms: []
    }
  },
  methods: {
    checkPermission,
    toQuery() {
      this.$parent.page = 0
      this.$parent.init()
    },
    handleReset() {
      this.query = {
        limit: 20,
        page: 1,
        status: null,
        start_time: null,
        end_time: null,
        source: null,
        goods_title: null,
        sku_type: null,
        goods_info: null,
        price: null,
        external_procure_number: null,
        consignee: null,
        phone: null
      }
      this.datePicker = []
      this.getList()
    }
  }
}
</script>
